package com.kuang.springcloud.Controller;

import com.kuang.springcloud.Service.IUserService;
import com.kuang.springcloud.pojo.User;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
public class UserController {
    @Resource
    IUserService userService;

    @PostMapping("/user/add")
    public Boolean addOne(@RequestBody User user){
        return userService.addOne(user);
    }
    @GetMapping("/user/getOne/{id}")
    public User selectOne(@PathVariable("id") Integer id){
        return userService.selectOne(id);
    }
    @GetMapping("/user/getAll")
    public List<User> selectAll(){
        return userService.selectAll();
    }
}
